AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

include( "shared.lua" )

function ENT:Initialize()

	self.Entity:PhysicsInit( SOLID_VPHYSICS )
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
	self.Entity:SetSolid( SOLID_VPHYSICS )

	self.Entity:SetUseType(SIMPLE_USE)
	
	local phys = self.Entity:GetPhysicsObject()
	if( phys:IsValid() ) then phys:Wake() end
end

function ENT:SetItem( class, quantity )
	if not GetItem( class ) then return end

	local item = GetItem( class )

	self.Item = item
	--table.Inherit( 

	self.Entity:SetModel( item.Model )
	
	PrintTable( self:GetTable() )
	
	print("ITEM SET!")
end

function ENT:GetItem()
	return self.Item
end

function ENT:SyncItem()
	print("RP_WorldItemSync, Server side")
	
	local rp = RecipientFilter()
	rp:AddAllPlayers()
	
	umsg.Start("RP_WorldItemSync", rp )
		umsg.Entity( self )
		umsg.String( self.Class )
	umsg.End()
end